import { ajax } from '../http.js';

const finduserAppsUrl = '/authc/user_rank/find_user_apps'; // 查询工作台应用
const categoryAllUrl = '/product_b2b/find_industry'; // 采购商城类目
const categoryShopUrl = '/product_b2b/find_by_industry'; // 按类目查询商品
const hotSaleUrl = '/product_b2b/find_hot_sale'; // 工作台商品列表（热销采购）
const queryFindPageUrl = '/act/query/find_page'; // 学习成长
const addUserAppsUrl = '/authc/user_rank/add_user_apps'; // 更多应用--保存


const finduserApps = (data, success, fail) =>// 查询工作台应用
  ajax({
    url: finduserAppsUrl,
    data: data,
    success: success,
    fail: fail
  });
const categoryAll = (data, success, fail) =>// 采购商城类目
  ajax({
    url: categoryAllUrl,
    data: data,
    success: success,
    fail: fail
  });
const categoryShops = (data, success, fail) =>// 按类目查询商品
  ajax({
    url: categoryShopUrl,
    data: data,
    success: success,
    fail: fail
  });
const hotSale = (data, success, fail) =>// 工作台商品列表（热销采购）
  ajax({
    url: hotSaleUrl,
    data: data,
    success: success,
    fail: fail
  });
const queryFindPage = (data, success, fail) =>// 学习成长
  ajax({
    apiUrl: '/actapi',
    url: queryFindPageUrl,
    data: data,
    success: success,
    fail: fail
  });
const addUserApps = (data, success, fail) =>// 更多应用--保存
  ajax({
    url: addUserAppsUrl,
    data: data,
    success: success,
    fail: fail
  });

export {
  finduserApps,
  categoryAll,
  categoryShops,
  hotSale,
  queryFindPage,
  addUserApps
}